<?php 
      echo $this->Html->css("chosen");
      echo $this->Html->css("dataTables");
      echo $this->Html->css("validationEngine.jquery");
 ?>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/dataTables.min.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/customInput.jquery.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/chosen.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/zice.custom1.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/ColVis.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/layout_table.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/manager_unit.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.validationEngine.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.validationEngine-vi.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.autotab.js"></script>

<div class="titlePage">
<h1>Quản lý đơn vị sản phẩm - Sản phẩm</h1>
</div>
<div class="onecolumn">
	<div class="header">
		<span><span class="ico gray shopping_basket"></span>Đơn vị sản phẩm</span>
	</div>
	<div class=" clear"></div>
	<div class="content">
             	<form id="validation">
							<div class="tableName">
								<table class="display data_table2 listUnitProduct" >
									<thead>
										<tr>
											<th><div class="th_wrapp">Đơn vị sỉ</div></th>
											<th><div class="th_wrapp">Đơn vị lẻ</div></th>
											<th><div class="th_wrapp">Hệ số chuyển đổi</div></th>
											<th><div class="th_wrapp">Quản lý</div></th>
										</tr>
									</thead>
									<tbody>
									<?php 
				foreach ($units as $item) {
			?>
					<tr class="odd gradeX editU" id="<?php echo $item['u']['id'].'_edit'?>">
      					<td class='editFather'><div class='old_father'><?php  echo $item['u']['father'];?></div>
      						<input id="<?php echo $item['u']['id'].'_edit_n'?>" value ="<?php echo $item['u']['father'];?>" class='validate[required] tmp_father' style="display: none"/>
      					</td>
      					<td class='editChild'><div class='old_child'><?php echo $item['u']['child'];?></div>
      						<input id="<?php echo $item['u']['id'].'_edit_ch'?>" value ="<?php echo $item['u']['child'];?>" class='validate[required] tmp_child' style="display: none"/>
      					</td>
      					<td class='editConvert'><div class='old_convert'><?php  echo $item['u']['convert'];?></div>
      						<input id="<?php echo $item['u']['id'].'_edit_c'?>" value ="<?php echo $item['u']['convert'];?>" class='validate[required,min[1]] tmp_convert' style="display: none"/>
      					</td>
	      					<td >
                                <span class='btnEdit'>
                                      <a  title="Edit" >
                                           <img src="<?php echo $this->webroot; ?>img/icon/color_18/pencil.png" >
                                      </a>
                                 </span> 
                                 <span class="tip btnDelete" id="<?php echo $item['u']['id'] ?>_delete">
                                       <a title="Delete"  >
                                           <img src="<?php echo $this->webroot; ?>img/icon/color_18/delete.png" >
                                       </a>
                                </span> 
                                <span class='btnSave' style="display: none">
                                      <a  title="Save" >
                                           <img src="<?php echo $this->webroot; ?>img/icon/color_18/checkmark2.png" >
                                      </a>
                                 </span>
                                 <span class='btnCancel' style="display: none">
                                      <a  title="Cancel" >
                                           <img src="<?php echo $this->webroot; ?>img/icon/color_18/cross.png" >
					                                      </a>
					                                 </span>
					                            </td>
      										</tr><?php }?>
					</tbody>
				</table>
            </div>
		</form>
		<div id="alert_product"></div>
		<form id="validation">
			<a class="uibutton icon add addNewUnit">Thêm mới</a>
			<div class="newUnit">
				<h4>Đơn vị sản phẩm mới</h4>
				<div class="section newUnitChild">
					<label>
					Đơn vị lẻ:
					
					</label>
					<div>
						<input class="validate[required] large" type="text" id="unit_child">
						
					</div>
				</div>
				<div class="buttonNewUnit">
					<a class="uibutton add_unit_child"><span class="ico gray checkmark2"></span>Lưu</a>
				</div>
				<div class="section">
					<label>
					Đơn vị sỉ:
					
					</label>
					<div>
						<input class="validate[required] large" type="text" id="unit_father">
						
					</div>
				</div>
				<div class="section numericonly">
					<label>
					Hệ số chuyển đổi:
					
					</label>
					<div>
						<input class="validate[required,custom[onlyNumberSp],min[1]] large" type="text" id="unit_convert">
						
					</div>
				</div>
				<div class="buttonNewUnit">
					<a class="uibutton add_unit"><span class="ico gray checkmark2"></span>Lưu</a>
					<a class="uibutton special cancel"><span class="ico gray cross"></span>Hủy</a>
				</div>
			</div>
		</form>
	</div>
</div>